$(function () {

  FB.init({
    appId  : fb_app_id,
    frictionlessRequests: true
  });

	$('.promos .slides').slides({
		preload: true,
		preloadImage: base_url+'application/images/loader.gif',
		play: 9000,
		pause: 2000,
		effect: 'fade',
		hoverPause: true,
		paginationClass: "pagination_slid"
	});

	$("#accil, #armpaq").on("click", function(){
		$(".opcbtns").removeClass("sel");
		$(this).addClass("sel");

		$("#slid_armpaq, #slid_accil").hide();
		var ss = $("#slid_"+$(this).attr("id")).show();
		$("span", ss).css("display", "none");
		$("a", $(".pagination li", ss).first()).click();
	});

  $('#fb_invita_link').on("click", function(){
    FB.ui({method: 'apprequests',
      message: username + ' te invita a la Tienda de conocimiento Capp.'
    }, function () {});
  });

});
